package pl.jad.database.table.column;

import java.lang.reflect.Field;

import pl.jad.database.table.Table;

abstract public class AbstractIndexTableColumn  extends PrimitiveTableColumn {

	protected boolean _isPrimaryKey = true;
	
	public AbstractIndexTableColumn(Table table, Field field) {
		super(table, field);
	}

	public void setIsPrimaryKey(boolean isPK) {
		this._isPrimaryKey = isPK;
	}
	
	public String getSqlType() {
		return super.getSqlType() + " NOT NULL" 
			+ ((this._isPrimaryKey) ? " PRIMARY KEY" : "");
	}
}
